/**
 * Created by IntelliJ IDEA.
 * User: Taras_Brzezinsky
 * Date: 8/29/11
 * Time: 6:02 PM
 * To change this template use File | Settings | File Templates.
 */

import java.util.*;
import java.io.*;
import java.math.BigInteger;

public class TaskN extends Thread {
    public TaskN() {
        try {
            this.input = new BufferedReader(new FileReader("input.txt"));
            this.output = new PrintWriter("output.txt");
            this.setPriority(Thread.MAX_PRIORITY);
        } catch (Throwable e) {

        }
    }

   

    private void solve() throws Throwable {
        int n = nextInt() % 26;
        String current =null;
        while ((current = input.readLine()) != null) {
            for (int i = 0; i < current.length(); ++i) {
                if (!Character.isLetter(current.charAt(i))) {
                    output.print(current.charAt(i));
                } else {
                    if (Character.isUpperCase(current.charAt(i))) {
                        int shift = current.charAt(i) - 'A';
                        shift = (shift + n) % 26;
                        output.print((char) ('A' + shift));
                    } else {
                        int shift = current.charAt(i) - 'a';
                        shift = (shift + n) % 26;
                        output.print((char) ('a' + shift));
                    }
                }
            }
            output.println();
        }
    }

    public void run() {
        try {
            solve();
        } catch (Throwable e) {
            System.err.println(e.getMessage());
            e.printStackTrace();
            System.exit(666);
        } finally {
            output.flush();
            output.close();
        }
    }

    public static void main(String[] args) {
        new TaskN().start();
    }

    private int nextInt() throws IOException {
        return Integer.parseInt(nextToken());
    }

    private long nextLong() throws IOException {
        return Long.parseLong(nextToken());
    }

    private double nextDouble() throws IOException {
        return Double.parseDouble(nextToken());
    }

    private String nextToken() throws IOException {
        while (tokens == null || !tokens.hasMoreTokens()) {
            tokens = new StringTokenizer(input.readLine());
        }
        return tokens.nextToken();
    }
    private BufferedReader input;
    private PrintWriter output;
    private StringTokenizer tokens = null;
}
